/**
 * 教师模块API
 */

import axios from './request';

/**
 * 登录
 * @param {*} user 
 * @returns 
 */
export const Login = (user) => axios.post('/teachers/login', user);

/**
 * 搜索
 * @param {*} teacher 
 * @returns 
 */
export const search = (teacher) => axios.get('/teachers/search', { params: teacher });

/**
 * 修改密码
 * @param {*} teacher 
 * @returns 
 */
export const UpdatePassword = teacher => axios.put('/teachers/updatePassword', teacher);

/**
 * 修改教师信息
 * @param {*} teacher 
 * @returns 
 */
export const UpdateTeacher = teacher => axios.put('/teachers/update', teacher);

/**
 * 添加教师
 * @param {*} teacher 
 * @returns 
 */
export const AddTeacher = teacher => axios.post('/teachers/add', teacher);

/**
 * 修改状态
 * @param {*} teacher 
 * @returns 
 */
export const UpdateStatus = teacher => axios.put('/teachers/updateStatus', teacher);

/**
 * 修改教师角色
 * @param {*} teacher 教师信息
 * @returns 
 */
export const ChangeRoles = teacher => axios.post('/teachers/addRoles', teacher);

/**
 * 添加教师紧急联系人
 * @param {*} emergency 紧急联系人信息
 * @returns 
 */
export const AddEmergency = emergency => axios.post('/emergency/add', emergency);

/**
 * 修改教师紧急联系人
 * @param {*} emergency 紧急联系人信息
 * @returns 
 */
export const UpdateEmergency = emergency => axios.put('/emergency/update', emergency);

/**
 * 删除教师紧急联系人
 * @param {*} id 紧急联系人id
 * @returns 
 */
export const DeleteEmergency = id => axios.delete('/emergency/delete/' + id);

/**
 * 获取教师紧急联系人
 * @param {*} id 紧急联系人id
 * @returns 
 */
export const GetEmergencyList = id => axios.get('/emergency/list/' + id);

/**
 * 搜索有效列表
 * @param {*} obj 搜索对象
 * @returns 
 */
export const SearchAvailable = obj => axios.get('/teachers/searchAvailable', { params: obj });

/**
 * 搜索工作状态列表
 * @param {*} obj 搜索对象
 * @returns 
 */
export const SearchStatus = obj => axios.get('/teachers/searchStatus', { params: obj });